﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Hired
{
    public partial class viewjobs : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            List<object> jobsToDisplay = new List<object>();
            string industry = Request.QueryString["industry"];
            if (industry != null)
            {
                lblIndustry.Text = industry;
                jobsToDisplay = DBJob.RetrieveJobsByIndustry(industry);
                gvJobs.DataSource = jobsToDisplay;
                gvJobs.DataBind();
            }
        }
        //public List<object> returnJobsList(List<Job> jobsResult)
        //{
        //    return
        //            (from j in jobsResult
        //             select new
        //             {
        //               Title = j.Title,
        //               Description = j.Description,
        //               MinimumQualifications = j.MinimumQualifications,
        //               EstimatedSalary = j.EstimatedSalary,
        //               WorkingHours = j.WorkingHours,
        //               Type = j.Type,
        //               Timestamp = j.Timestamp,
        //               Location = j.Location,
        //               Industry = j.Industry,
        //               Employer = j.CompanyAccount.Company.CompanyName,  
        //               JobId = j.JobID,
        //               CompanyId = j.CompanyAccount.CAccountID
        //             }).ToList<object>();
        //}
    }
}